package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Getter
@Setter
public class NoticeQueryObject extends QueryObject{

    private Boolean seekRead;
    private Integer seekLevel;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date lastDate ;

    //已看过的公告
    private List<Long> read;

    private boolean admin;
    private Long  id;
    public Date getLastDate(){
        if ( lastDate != null){
        return DateUtil.endOfDay(lastDate);
        }
        return null;
    }
}
